//
// Decompiled by Jadx - 585ms
//
package fg;

import android.app.Activity;
import androidx.appcompat.app.t;
import com.google.gson.Gson;
import de.robv.android.xposed.XC_MethodHook;
import fg.p;
import fi.c;
import fi.w;
import fi.y;
import fn.b;
import fn.j;
import gf.z;
import java.util.List;
import me.plusne.Adapter.Login.HookSetListAdapter;
import me.plusne.common.Http.Home;
import me.plusne.common.Json.JsonPick;
import me.plusne.common.Json.Login.JsonLoginQuerySet;
import me.plusne.common.Json.WX.GameJson;
import r.g;

public final class n implements w.b, w.e, w.c {
    public final Object a;
    public final Object b;
    public final Object c;
    public final Object d;

    public n(Object obj, Object obj2, Object obj3, Object obj4) {
        this.a = obj;
        this.b = obj2;
        this.c = obj3;
        this.d = obj4;
    }

    public final void g(w wVar, boolean z) {
        HookSetListAdapter.a aVar = (HookSetListAdapter.a) this.a;
        JsonLoginQuerySet.SetBean setBean = (JsonLoginQuerySet.SetBean) this.b;
        w wVar2 = (w) this.c;
        HookSetListAdapter hookSetListAdapter = (HookSetListAdapter) this.d;
        int i = HookSetListAdapter.a.a;
        aVar.getClass();
        b.l(new Gson().toJson(wVar2.aa.a), setBean.getKey());
        hookSetListAdapter.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
        aVar.k(setBean);
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        p.a aVar = (p.a) this.a;
        Activity activity = (Activity) this.b;
        JsonPick.DataBean dataBean = (JsonPick.DataBean) this.c;
        p pVar = (p) this.d;
        aVar.getClass();
        if (z) {
            y.e(activity);
            String o = g.o();
            long id = dataBean.getId();
            t.c().j(((Home) dq.b.b(Home.class)).redeemPrize(o, id, str).subscribeWith(new o(aVar, activity, pVar, activity, str)));
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        Object obj;
        Object obj2;
        String str = (String) this.a;
        XC_MethodHook.MethodHookParam methodHookParam = (XC_MethodHook.MethodHookParam) this.b;
        List list = (List) this.c;
        List list2 = (List) this.d;
        int i3 = z.a.a;
        if (str.startsWith("dice")) {
            if (i2 < 6) {
                j.bn(methodHookParam.args[1], "field_name", ((GameJson) list.get(i2)).getName());
                obj = methodHookParam.args[1];
                obj2 = list.get(i2);
                j.bn(obj, "field_md5", ((GameJson) obj2).getMd5());
            }
        } else if (i2 < 3) {
            j.bn(methodHookParam.args[1], "field_name", ((GameJson) list2.get(i2)).getName());
            obj = methodHookParam.args[1];
            obj2 = list2.get(i2);
            j.bn(obj, "field_md5", ((GameJson) obj2).getMd5());
        }
        j.w(methodHookParam);
        wVar.az();
    }
}
